#version 130

attribute vec3 vertex;
attribute vec3 normal;
attribute vec3 tangent;
attribute vec3 color;
attribute vec2 UV;

uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 ModelViewMatrix;
uniform mat4 ViewProjectionMatrix;
uniform mat4 ModelViewProjectionMatrix;
uniform mat3 NormalMatrix;

varying vec3 outNormal;
varying vec3 outTangent;
varying vec3 outColor;
varying vec2 outUV;
varying vec3 position;
varying vec3 outPosition;


void main() {
	float aux;
	aux = vertex[0] * ( 1 + sin(vertex[1]+vertex[2]) );
	vec3 vertex2 = vertex;
	vertex2[0] = aux;
	gl_Position = ProjectionMatrix * ViewMatrix * ModelMatrix * vec4(vertex2,1.0);
	outPosition = vec3(ModelMatrix * vec4(vertex2,1.0));
	outNormal = NormalMatrix * normal;
	outTangent = NormalMatrix * outTangent;
	outColor = color;
	outUV = UV;
}
